load(
    "//tools/skylark:drake_cc.bzl",
    "drake_cc_googletest",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/workspace/ros_xacro_internal:defs.bzl", "xacro_file")

package(default_visibility = ["//visibility:public"])

xacro_file(
    name = "ur3e_spheres_collision.urdf",
    src = "ur3e_spheres_collision.urdf.xacro",
    data = [
        "ur.transmission.xacro",
        "ur3e.urdf.xacro",
    ],
)

xacro_file(
    name = "ur3e_cylinders_collision.urdf",
    src = "ur3e_cylinders_collision.urdf.xacro",
    data = [
        "ur.transmission.xacro",
        "ur3e.urdf.xacro",
    ],
)

filegroup(
    name = "glob_models",
    srcs = [
        "ur3e_cylinders_collision.urdf",
        "ur3e_spheres_collision.urdf",
    ],
    visibility = ["//visibility:private"],
)

install_data(
    name = "install_data",
    data = [":glob_models"],
)

filegroup(
    name = "models",
    srcs = [
        ":glob_models",
        "@drake_models//:ur3e/base.mtl",
        "@drake_models//:ur3e/base.obj",
        "@drake_models//:ur3e/forearm.mtl",
        "@drake_models//:ur3e/forearm.obj",
        "@drake_models//:ur3e/shoulder.mtl",
        "@drake_models//:ur3e/shoulder.obj",
        "@drake_models//:ur3e/upperarm.mtl",
        "@drake_models//:ur3e/upperarm.obj",
        "@drake_models//:ur3e/ur3e_color.png",
        "@drake_models//:ur3e/ur3e_normal.png",
        "@drake_models//:ur3e/ur3e_occlusion_roughness_metallic.png",
        "@drake_models//:ur3e/wrist1.mtl",
        "@drake_models//:ur3e/wrist1.obj",
        "@drake_models//:ur3e/wrist2.mtl",
        "@drake_models//:ur3e/wrist2.obj",
        "@drake_models//:ur3e/wrist3.mtl",
        "@drake_models//:ur3e/wrist3.obj",
    ],
)

# === test/ ===

drake_cc_googletest(
    name = "parse_test",
    srcs = ["test/parse_test.cc"],
    data = [
        ":models",
    ],
    deps = [
        "//common:find_resource",
        "//multibody/parsing",
    ],
)

add_lint_tests()
